package com.bookmarket.dao;

import com.bookmarket.entity.*;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface LJOrderListMapper {
    //根据前台传过来的name查询对应用户所有的信息
    Custom selectBy(String name);
    /*****************************************************************/
    //查询地址
    List<Address> selectByCustom(Custom custom);
    //添加地址
    boolean insertAddress(Address address);
    //删除地址
    boolean delAddress(int id);
    //修改地址
    boolean updateAddress(Address address);

    /******************************************************************/
    //根据地址id查询对应的地址
    Address selectById(int id);
    //向订单表插入地址表相关信息
    boolean insertByOrder(Order order);
    boolean insertByOrder2(Map map);
    //根据商品id查询对应的商品信息
    Shop selectByShopId(int id);
    //查看刚刚插入订单的主键id
    Order selectByOrder(Order order);
    //向关系表tb_order_book存数据
    boolean insertOrderBook(Order_Book order_book);
    /******************************************************************/
    //根据商品id查看商品表中book_id(外键值)
    int chaId(int id);
    //根据地址id查看地址表中custom_id(外键值)
    int chaAddressId(int id);

    boolean delOrderByOrderList(int id);

    List<Map> queryDiscount(int customId);

    boolean deleteDiscount(int id);

    boolean modOrderState(int id);

    boolean deleteBookById(int id);
}
